{% extends "./admin/layout.html" %}
{% block title %}发布文章{% endblock %}
{% block head %}
    {{ super() }}
    <script src="{{ url_for('static', filename='js/zui/lib/kindeditor/kindeditor.min.js') }}"></script>
{% endblock %}
{% block content %}
    <div class="row" style="margin: 100px 200px 0px 200px;">
        <div class="col-md-5">
            {% block nav %}
                {{ super() }}
            {% endblock %}
        </div>
        <div class="col-md-7">

            <div class="input-group">
                <form action="" method="post" enctype="multipart/form-data">
                    栏目分类：
                    <select name="fid">
                        {% for i in data.column %}
                            {% if i.fid == 0 %}
                                <option value="{{ i.id }}">
                                    {{ i.title }}
                                </option>
                                {% for n in data.column %}
                                    {% if n.fid == i.id %}
                                        <option value="{{ n.id }}">
                                            -----{{ n.title }}
                                        </option>
                                    {% endif %}
                                {% endfor %}

                            {% endif %}

                        {% endfor %}
                    </select>
                    <br>

                    <div class="input-group">
                        <span class="input-group-addon">标题</span>
                        <input type="text" name="title" class="form-control" placeholder="标题">
                    </div>
                    <div class="input-group">
                        <span class="input-group-addon">摘要</span>
                        <textarea name="intro">
                        </textarea>
                    </div>
                    <div class="input-group">
                        <span class="input-group-addon">缩略图</span>
                        <input type="file" name="file" class="form-control">
                    </div>
                    <textarea id="content" name="content" class="form-control kindeditor"
                              style="height:150px;"></textarea>
                    <script>
                        KindEditor.create('textarea.kindeditor', {
                            basePath: "{{ url_for('static', filename='js/zui/lib/kindeditor/') }}",
                            allowFileManager: true,
                            bodyClass: 'article-content'
                        });
                    </script>
                    <input class="btn btn-primary" type="submit" value="提交">

                </form>
            </div>


        </div>
    </div>
{% endblock %}